{
  "variables": [
    {
      "name": "start_time",
      "type": "PX_STRING",
      "description": "The relative start time of the window. Current time is assumed to be now",
      "defaultValue": "-5m"
    },
    {
      "name": "node",
      "type": "PX_NODE",
      "description": "The node name to filter on"
    },
    {
      "name": "groupby",
      "type": "PX_STRING",
      "description": "The element to groupby",
      "defaultValue": "node",
      "validValues": [
        "node",
        "service",
        "pod",
        "namespace"
      ]
    }
  ],
  "globalFuncs": [
    {
      "outputName": "resource_timeseries",
      "func": {
        "name": "resource_timeseries",
        "args": [
          {
            "name": "start_time",
            "variable": "start_time"
          },
          {
            "name": "node",
            "variable": "node"
          },
          {
            "name": "groupby",
            "variable": "groupby"
          }
        ]
      }
    },
    {
      "outputName": "network_stats",
      "func": {
        "name": "network_stats",
        "args": [
          {
            "name": "start_time",
            "variable": "start_time"
          },
          {
            "name": "node",
            "variable": "node"
          },
          {
            "name": "groupby",
            "variable": "groupby"
          }
        ]
      }
    }
  ],
  "widgets": [
    {
      "name": "Pods",
      "position": {
        "x": 0,
        "y": 0,
        "w": 8,
        "h": 3
      },
      "func": {
        "name": "pods_for_node",
        "args": [
          {
            "name": "start_time",
            "variable": "start_time"
          },
          {
            "name": "node",
            "variable": "node"
          }
        ]
      },
      "displaySpec": {
        "@type": "types.px.dev/px.vispb.Table",
        "gutterColumn": "status"
      }
    },
    {
      "name": "CPU Usage",
      "position": {
        "x": 8,
        "y": 0,
        "w": 4,
        "h": 3
      },
      "globalFuncOutputName": "resource_timeseries",
      "displaySpec": {
        "@type": "types.px.dev/px.vispb.TimeseriesChart",
        "timeseries": [
          {
            "value": "cpu_usage",
            "mode": "MODE_LINE",
            "series": "groupby_col"
          }
        ],
        "title": "",
        "yAxis": {
          "label": "CPU usage"
        },
        "xAxis": null
      }
    },
    {
      "name": "Bytes read",
      "position": {
        "x": 0,
        "y": 3,
        "w": 4,
        "h": 3
      },
      "globalFuncOutputName": "resource_timeseries",
      "displaySpec": {
        "@type": "types.px.dev/px.vispb.TimeseriesChart",
        "timeseries": [
          {
            "value": "total_disk_read_throughput",
            "mode": "MODE_LINE",
            "series": "groupby_col"
          }
        ],
        "title": "",
        "yAxis": {
          "label": "Bytes read"
        },
        "xAxis": null
      }
    },
    {
      "name": "Bytes written",
      "position": {
        "x": 4,
        "y": 3,
        "w": 4,
        "h": 3
      },
      "globalFuncOutputName": "resource_timeseries",
      "displaySpec": {
        "@type": "types.px.dev/px.vispb.TimeseriesChart",
        "timeseries": [
          {
            "value": "total_disk_write_throughput",
            "mode": "MODE_LINE",
            "series": "groupby_col"
          }
        ],
        "title": "",
        "yAxis": {
          "label": "Bytes written"
        },
        "xAxis": null
      }
    },
    {
      "name": "Sent Network Traffic",
      "position": {
        "x": 8,
        "y": 3,
        "w": 4,
        "h": 3
      },
      "globalFuncOutputName": "network_stats",
      "displaySpec": {
        "@type": "types.px.dev/px.vispb.TimeseriesChart",
        "timeseries": [
          {
            "value": "tx_bytes_per_ns",
            "mode": "MODE_LINE",
            "series": "groupby_col"
          }
        ],
        "title": "",
        "yAxis": {
          "label": "Sent Data"
        },
        "xAxis": null
      }
    },
    {
      "name": "Received Network Traffic",
      "position": {
        "x": 0,
        "y": 6,
        "w": 4,
        "h": 3
      },
      "globalFuncOutputName": "network_stats",
      "displaySpec": {
        "@type": "types.px.dev/px.vispb.TimeseriesChart",
        "timeseries": [
          {
            "value": "rx_bytes_per_ns",
            "mode": "MODE_LINE",
            "series": "groupby_col"
          }
        ],
        "title": "",
        "yAxis": {
          "label": "Received Data"
        },
        "xAxis": null
      }
    },
    {
      "name": "Resident Set Size",
      "position": {
        "x": 4,
        "y": 6,
        "w": 4,
        "h": 3
      },
      "globalFuncOutputName": "resource_timeseries",
      "displaySpec": {
        "@type": "types.px.dev/px.vispb.TimeseriesChart",
        "timeseries": [
          {
            "value": "rss",
            "mode": "MODE_LINE",
            "series": "groupby_col",
            "stackBySeries": false
          }
        ],
        "title": "",
        "yAxis": {
          "label": "Resident Memory Usage"
        },
        "xAxis": null
      }
    },
    {
      "name": "Virtual Memory Size",
      "position": {
        "x": 8,
        "y": 6,
        "w": 4,
        "h": 3
      },
      "globalFuncOutputName": "resource_timeseries",
      "displaySpec": {
        "@type": "types.px.dev/px.vispb.TimeseriesChart",
        "timeseries": [
          {
            "value": "vsize",
            "mode": "MODE_LINE",
            "series": "groupby_col",
            "stackBySeries": false
          }
        ],
        "title": "",
        "yAxis": {
          "label": "Virtual Memory Usage"
        },
        "xAxis": null
      }
    },
    {
      "name": "CPU Flamegraph",
      "position": {
        "x": 0,
        "y": 9,
        "w": 12,
        "h": 5
      },
      "func": {
        "name": "stacktraces",
        "args": [
          {
            "name": "start_time",
            "variable": "start_time"
          },
          {
            "name": "node",
            "variable": "node"
          }
        ]
      },
      "displaySpec": {
        "@type": "types.px.dev/px.vispb.StackTraceFlameGraph",
        "stacktraceColumn": "stack_trace",
        "countColumn": "count",
        "percentageColumn": "percent",
        "namespaceColumn": "namespace",
        "podColumn": "pod",
        "containerColumn": "container",
        "pidColumn": "cmdline",
        "percentageLabel": "CPU Usage"
      }
    }
  ]
}
